from abc import ABC, abstractmethod
import pandas as pd
from typing import Dict, Any

class StrategyBase(ABC):
    def __init__(self, parameters: Dict[str, Any] = None):
        self.parameters = parameters or {}

    @abstractmethod
    def generate_signals(self, data: pd.DataFrame) -> pd.Series:
        """
        Generate trading signals based on the strategy logic
        Returns a pandas Series with 1 (buy), -1 (sell), or 0 (hold)
        """
        pass

    def set_parameters(self, parameters: Dict[str, Any]):
        """
        Update strategy parameters
        """
        self.parameters.update(parameters) 